package practice;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

public class Demo04WriteString {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("hzx.zs");
        String line = "答案";
        byte[] b = line.getBytes(StandardCharsets.UTF_8);
        fos.write(b);
        System.out.println("写出完毕！");
        fos.close();
    }
}
